package com.ist.smartmonitor.client;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.maps.client.geom.LatLng;

public class StatusUpdateEvent extends
		GwtEvent<StatusUpdateEvent.StatusUpdateHandler> {
	
	private final LatLng latlng;

	public interface StatusUpdateHandler extends EventHandler {
		void onStatusUpdate(StatusUpdateEvent event);
	}

	private static final GwtEvent.Type<StatusUpdateEvent.StatusUpdateHandler> TYPE = 
		new GwtEvent.Type<StatusUpdateHandler>();

	public static GwtEvent.Type<StatusUpdateHandler> getType() {
		return TYPE;
	}

	public StatusUpdateEvent(LatLng latlng) {
		this.latlng = latlng;
	}

	public LatLng getLatLng() {
		return latlng;
	}

	@Override
	protected void dispatch(StatusUpdateEvent.StatusUpdateHandler handler) {
		handler.onStatusUpdate(this);
	}

	@Override
	public GwtEvent.Type<StatusUpdateHandler> getAssociatedType() {
		return TYPE;
	}

}
